package main

import (
	"lsis/models"
	_ "lsis/routers"

	"github.com/astaxie/beego"
)

func main() {
	models.Init()

	beego.BConfig.Listen.EnableHTTPS = true
	beego.BConfig.Listen.HTTPSCertFile = "sslKey/2_i-hea.com.crt"
	beego.BConfig.Listen.HTTPSKeyFile = "sslKey/3_i-hea.com.key"
	beego.BConfig.Listen.HTTPSAddr = "0.0.0.0"
	beego.BConfig.Listen.HTTPSPort = 443

	if beego.BConfig.RunMode == "dev" {

		beego.BConfig.WebConfig.DirectoryIndex = true
		beego.BConfig.WebConfig.StaticDir["/swagger"] = "swagger"

	} else if beego.BConfig.RunMode == "prod" {

		beego.BConfig.Listen.EnableHTTP = false
	}

	beego.Run()
}
